// 权限问题后期增加
import { get, post } from '@/utils/http/axios';
import { UserState } from '@/store/modules/user/types';
import { URL } from './enum';

// import axios from 'axios';

interface LoginRes {
	token: string;
}

export interface LoginData {
	username: string;
	password: string;
}

const getUserProfile = async () => get<UserState>(URL.profile);
const login = async (data: LoginData) => post<any>(URL.login, data);
const logout = async () => post<LoginRes>(URL.logout);
export { getUserProfile, logout, login };
